<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title999</title>
    <link rel="stylesheet" href="plugin/layui/css/layui.css">
    <script src="plugin/layui/layui.all.js" />
    <script src="js/vue.js"></script>
</head>
<body>
<div>72222222222222222222222222</div>
<!--<button type="button" class="layui-btn" id="test1">
    <i class="layui-icon">&#xe67c;</i>上传图片
</button>-->

.
</body>
</html>
<script>
    main(function () {
        console.log("我是回调函数！");
    });
    //对象数组
    var pdts = [{
        title: "z-paint pot",
        quantity: 9,
        price: 3.95
    },{
        title: "iPhone XS",
        quantity: 10,
        price: 8906.72
    },{
        title: "polka dots",
        quantity: 17,
        price: 12.3
    }, {
        title: "pebbles",
        quantity: 5,
        price: 6.71
    }, {
        title: "Mi Note5",
        quantity: 8,
        price: 2985.6
    }];
    function main(callback){
        console.log("我是主函数！");
        callback();
    }


    //按价格升序
    pdts.sort(function(x,y){
        return x.price-y.price;
    });

    for (var i = 0; i <pdts.length ; i++) {
        console.log(JSON.stringify(pdts[i]))
    }
</script>